<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .banner {
            width: 1000px;
            height: 300px;
            background-color: #ddd;
            margin: auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            overflow: hidden;
        }

        .banner1,
        .banner2 {
            width: 200px;
            height: 200px;
            background-color: #f00;
        }

        .banner1 {
            animation: a .3s;
        }

        .banner2 {
            transform: translateY(300px);
            /* 动画时长  延迟时长   forwards停留在动画结束的状态 */
            animation: b .3s .3s forwards;
        }


        @keyframes a {
            0% {
                transform: translateY(-300px);
            }

            100% {
                transform: translateY(0);
            }
        }

        @keyframes b {
            0% {
                transform: translateY(300px);
            }

            100% {
                transform: translateY(0);
            }
        }
    </style>
</head>

<body>

    <div class="banner">
        <div class="banner1"></div>
        <div class="banner2"></div>
    </div>

</body>

</html>